<md-content class="workspace-members-panel" ng-if="shareWorkspaceController.noPermissionsError">
  <md-progress-linear md-mode="indeterminate" ng-show="shareWorkspaceController.isLoading"></md-progress-linear>
  <div ng-show="!shareWorkspaceController.isLoading">
    <che-list-header flex="100"
                     che-input-placeholder="Search"
                     che-search-model="shareWorkspaceController.userFilter.email"
                     che-on-search-change="shareWorkspaceController.onSearchChanged(str)"
                     che-hide-search="shareWorkspaceController.users.length === 0"
                     che-add-button-title="Add Developer"
                     che-on-add="shareWorkspaceController.showShareWorkspaceDialog($event)"
                     che-delete-button-title="Delete"
                     che-on-delete="shareWorkspaceController.deleteSelectedWorkspaceMembers()"
                     che-hide-delete="shareWorkspaceController.cheListHelper.isNoItemSelected"
                     che-hide-header="shareWorkspaceController.cheListHelper.visibleItemsNumber === 0">
      <div flex="100"
           layout="row"
           layout-align="start stretch"
           class="che-list-item-row">
        <div layout="column" layout-gt-xs="row"
             layout-align="start center"
             class="che-checkbox-area">
          <div layout="row" layout-align="start center" class="che-list-item-checkbox-main">
            <md-checkbox class="che-list-item-checkbox md-default-theme"
                         id="share-workspace-bulk-selection"
                         aria-label="Bulk check on users"
                         ng-checked="shareWorkspaceController.cheListHelper.areAllItemsSelected"
                         ng-click="shareWorkspaceController.cheListHelper.changeBulkSelection()"></md-checkbox>
          </div>
        </div>
        <div flex hide-xs layout-gt-xs="row"
             layout-align="start center"
             class="che-list-item-details">
          <che-list-header-column flex-gt-xs="40"
                                  che-sort-value='shareWorkspaceController.userOrderBy'
                                  che-sort-item='email'
                                  che-column-title='Email'></che-list-header-column>
          <che-list-header-column flex-gt-xs="35"
                                  che-sort-value='shareWorkspaceController.userOrderBy'
                                  che-sort-item='permissions.actions'
                                  che-column-title='Permissions'></che-list-header-column>
          <che-list-header-column flex-gt-xs="25"
                                  che-column-title='Actions'></che-list-header-column>
        </div>
      </div>
    </che-list-header>
    <che-list flex ng-if="shareWorkspaceController.users && shareWorkspaceController.users.length > 0">
      <user-item
              ng-repeat="user in shareWorkspaceController.cheListHelper.getVisibleItems() | orderBy:shareWorkspaceController.userOrderBy"
              che-user="user" callback="shareWorkspaceController"></user-item>
    </che-list>

    <div class="che-list-empty">
        <span ng-show="shareWorkspaceController.users.length > 0 && shareWorkspaceController.cheListHelper.visibleItemsNumber === 0">
          No members found.
        </span>
      <span ng-show="shareWorkspaceController.users.length === 0">There are no members.</span>
    </div>
  </div>
</md-content>
<div ng-if="!shareWorkspaceController.noPermissionsError" class="no-permissions-error" layout="row" layout-align="center center">
  <span class="material-design icon-ic_error_outline_24px"></span>
  You have no access to view workspace permissions.
</div>
